package com.ungao.demo.mapper;

import com.ungao.demo.bean.UserInfo;
import com.ungao.framework.annotation.*;

import java.util.List;

@Mapper
public interface UserMapper {

    @Select("select * from user")
    List<UserInfo> selectList();

    @Select("select * from user where id=#{id}")
    UserInfo selectOne(int id);

    @Insert("insert into user(name,age) values(#{name},#{age})")
    int insert(String name, int age);

    @Update("update user set name=#{name},age=#{age} where id=#{id}")
    int update(int id, String name, int age);

    @Delete("delete from user where id=#{id}")
    int delete(int id);
}
